export default {
    namespaced: true,
    state: {
        // 用来控制登录提示框的显示和隐藏   
        toShowtoast: false,
        msg: "",
        type: ""
    },
    mutations: {
        // 修改toShowtoast的值
        chanToShowtoast(state, payload) {
            state.toShowtoast = payload.isshow
            state.msg = payload.msg
            state.type = payload.type
        }
    },
    actions: {
        asyncchanToShowtoast(context, payload) {
            context.commit("chanToShowtoast", {
                isshow: true,
                msg: payload.msg,
                type: payload.type,
            })
            setTimeout(() => {
                context.commit("chanToShowtoast", {
                    isshow: false,
                    msg: payload.msg,
                    type: payload.type,
                })
            }, 1500);
        }
    },
}
